package controller

import (
	"github.com/gin-gonic/gin"
	"log"
	"time"
)

// AsyncReq 异步
func AsyncReq(c *gin.Context) {
	contextCopy := c.Copy()
	go func() {
		time.Sleep(5 * time.Second)
		log.Println("异步执行：" + contextCopy.Request.URL.Path)
	}()

}

// SyncReq 同步
func SyncReq(c *gin.Context) {
	time.Sleep(5 * time.Second)
	log.Println("同步执行：" + c.Request.URL.Path)
}
